<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="mainMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="3" />
<title>角色管理</title>
<script>
	$(document).ready(
					function() {
						//聚焦第一个输入框
						$("#name").focus();
						//为inputForm注册validate函数
						$("#inputForm")
								.validate(
										{
											rules : {
												roleName : {
													required : true,
													remote : "role!checkRoleName.action?oldRoleName="
															+ encodeURIComponent('${roleName}')
												}
											},
											messages : {
												roleName : {
													remote : "<font color='red'>角色名已存在</font>"
												}
											}
										});
					});
</script>
</head>

<body>

<form action="role!save.action" method="post" id="inputForm"
	class="yform"><input type="hidden" name="id" value="${id}" />
	<div id="caption"><h6><s:if test="id == null">创建</s:if><s:else>修改</s:else>角色</h6></div>
<table class="noborder">
	<tr>
		<td>角色名<font color="red">*</font>:</td>
		<td><input type="text" id="roleName" name="roleName"
			value="${roleName}" /></td>
		<td>类型</td>
		<td><pt:code category="1003" name="category"
			default="${category}"></pt:code></td>
	</tr>
	<tr>
		<td>授权:</td>
		<td colspan="3"><s:checkboxlist name="checkedAuthIds"
			list="allAuthorityList" listKey="id" listValue="autName"
			theme="custom" /></td>
	</tr>
</table>
<div class="type-button"><input   type="submit"
			value="提交" />&nbsp; <input   type="button" class="reset" value="返回"
			onclick="history.back()" /></div>
</form>
</body>
</html>
